<template>
	<view class="page">
		<view class="bodys" v-for="(item,index) in dataList" :key="item.index">
			<checkbox-group @change="checkboxChange">
				<view class="justify-content-start">
					<view class="left">
						<label>
							<checkbox :value="item.value" :checked="item.checked" class="circle" />
						</label>
					</view>
					<view class="">
						<view class="bodys_cont justify-content-sp">
							<view class="bodys_cont_left">
								申请提现
							</view>
							<view class="bodys_cont_right">
								-800.28
							</view>
						</view>
						<view class="bodys_cont justify-content-start">
							<view class="bodys_cont_left gainsboro">
								提现时间:
							</view>
							<view class="bodys_cont_right2">
								2024-04-01 18:20:22
							</view>
						</view>
						<view class="bodys_cont justify-content-start">
							<view class="bodys_cont_left gainsboro">
								提现状态
							</view>
							<view class="bodys_cont_right2">
								提现成功，请关注银行到账信息
							</view>
						</view>
						<view class="bodys_cont justify-content-start">
							<view class="bodys_cont_left gainsboro">
								到账时间:
							</view>
							<view class="bodys_cont_right2">
								2024-04-01 18:20:22
							</view>
						</view>
						<view class="bodys_cont justify-content-start">
							<view class="status_3">
								系统处理中的记录删除时无法选择
							</view>
						</view>
					</view>
				</view>
			</checkbox-group>
		</view>
		<view class="bto justify-content-sp">
			<view class="bto_left">
				<checkbox-group @change="choose_isAll">
					<label>
						<checkbox value="isAll" :checked="isAll" style="transform:scale(0.7)" />全选
					</label>
				</checkbox-group>
			</view>
			<view class="bto_right">
				<view class="btn_css" @click="del">
					删除
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isAll: false,
				dataList: [{
						id: 0,
						value: '0',
						checked: false,
						money: -800.28,
						status: "提现成功，请关注银行到账信息",
						createTime: "2024-04-04 18:20:22",
						arriveTime: "2024-04-01 18:20:22"
					}, {
						id: 1,
						value: '1',
						checked: false,
						money: -800.28,
						status: "提现成功，请关注银行到账信息",
						createTime: "2024-04-04 18:20:22",
						arriveTime: "2024-04-01 18:20:22"
					},
					{
						id: 2,
						value: '2',
						checked: false,
						money: -800.28,
						status: "提现成功，请关注银行到账信息",
						createTime: "2024-04-04 18:20:22",
						arriveTime: "2024-04-01 18:20:22"
					}
				]
			}
		},
		onLoad() {

		},
		methods: {
			checkboxChange: function(e) {
				console.log(11);
				var values = e.detail.value;
				for (var i = 0, lenI = this.dataList.length; i < lenI; ++i) {
					const item = this.dataList[i]
					if (values.includes(item.value)) {
						this.$set(item, 'checked', true)
					} else {
						this.$set(item, 'checked', false)
					}
				}
			},
			choose_isAll(e) {
				console.log(e.detail.value);
				if (e.detail.value[0] == "isAll") {
					for (var i = 0; i < this.dataList.length; i++) {
						this.dataList[i].checked = true
					}
				} else {
					for (var i = 0; i < this.dataList.length; i++) {
						this.dataList[i].checked = false
					}
				}
			},
			// 删除订单
			del(e) {
				for (var i = 0; i < this.dataList.length; i++) {
					if (this.dataList[i].checked == true) {
						console.log(123, i);
						this.dataList.splice(i)
					}
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100%;

		.bodys {
			margin: 30rpx;
			padding: 30rpx;
			background-color: white;
			border-radius: 15rpx;

			.left {
				display: flex;
				flex-direction: column;
				justify-content: center;
			}

			.bodys_cont {
				line-height: 30px;

				.bodys_cont_left {
					font-weight: 550;
				}

				.bodys_cont_right {
					color: #ff693a;
				}

				.bodys_cont_right3 {
					color: #22AC38;
				}

				.bodys_cont_right2 {
					padding: 0 10rpx;
				}

				.status_3 {
					color: #ff693a;
					font-size: 15px;
				}
			}
		}

		.bto {
			width: 100%;
			position: fixed;
			background-color: white;
			bottom: 0;

			// padding: 0 30rpx;
			.bto_left {
				padding: 40rpx;
			}

			.bto_right {
				padding: 30rpx;

				.btn_css {
					background-color: #ff4b12;
					color: white;
					padding: 10rpx 30rpx;
					border-radius: 30rpx;
				}
			}

		}
	}
</style>